﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/Actor/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                    $("#F_UserPassword").val("******").attr('disabled', 'disabled');
                }
            });
        }
    });
    function initControl() {
        $("#F_Gender").bindSelect()
        $("#F_IsAdministrator").bindSelect()
        $("#F_EnabledMark").bindSelect()
        $("#F_OrganizeId").bindSelect({
            url: "/Actor/GetTreeSelectJson"
        });
        $("#F_DepartmentId").bindSelect({
            url: "/Actor/GetTreeSelectJson",
        });
        $("#F_RoleId").bindSelect({
            url: "/Actor/GetGridJson",
            id: "F_Id",
            text: "F_FullName"
        });
        $("#F_DutyId").bindSelect({
            url: "/Actor/GetGridJson",
            id: "F_Id",
            text: "F_FullName"
        });
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/Actor/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>
<form id="form1">
    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">基本信息</a></li>
            @*<li ><a href="#">扩展信息</a></li>*@
        </ul>
        <div style="padding-top: 20px; margin-right: 30px;">
            <table class="form">
                <tr>
                    <th class="formTitle" rowspan="2">图片</th>
                    <td class="formValue" rowspan="2">
                        @*<input id="F_Account" name="F_Account" type="text" class="form-control required" placeholder="请输入账户" />*@
                        <img src="" id="ImgUrl" />
                    </td>
                    <th class="formTitle">中文名</th>
                    <td class="formValue">
                        <input id="ChineseName" name="ChineseName" type="text" class="form-control required" placeholder="电影名" />
                    </td>
                </tr>
                <tr>
                    @*<th class="formTitle"></th>
                        <td class="formValue">
                            <select id="F_OrganizeId" name="F_OrganizeId" class="form-control required">
                            </select>
                        </td>*@
                    <th class="formTitle">英文名</th>
                    <td class="formValue">
                        <input id="Original_Name" name="Original_Name" type="text" class="form-control" placeholder="英文名" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">又名</th>
                    <td class="formValue">
                        <input id="OtherName" name="OtherName" type="text" class="form-control" placeholder="又名" />
                    </td>
                    <th class="formTitle">上映时间</th>
                    <td class="formValue">
                        <input id="OnPlayTime" name="OnPlayTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">年份</th>
                    <td class="formValue">
                        <input id="Year" name="Year" type="text" class="form-control required" placeholder="年份" />
                    </td>
                    <th class="formTitle">区域</th>
                    <td class="formValue">
                        <select id="MovieRegion" name="MovieRegion" class="form-control"></select>
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">演员</th>
                    <td class="formValue">
                        <input id="Actors" name="Actors" type="text" class="form-control required" placeholder="演员" />
                    </td>
                    <th class="formTitle">导演</th>
                    <td class="formValue">
                        <input id="director" name="Actors" type="text" class="form-control required" placeholder="导演" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">编剧</th>
                    <td class="formValue">
                        <input id="write" name="write" type="text" class="form-control required" placeholder="编剧" />
                    </td>
                    <th class="formTitle">类型</th>
                    <td class="formValue">
                        <select id="MovieType" name="MovieType" class="form-control  required"></select>
                    </td>
                </tr>
                <tr>
                    <th class="formTitle" valign="top" style="padding-top: 5px;">
                        电影介绍
                    </th>
                    <td class="formValue" colspan="3">
                        <textarea id="Summary" name="Summary" class="form-control" style="height: 60px;"></textarea>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
